package cn.leo.dynamic_multi_datasource.service;

import cn.leo.dynamic_multi_datasource.annotation.TargetDatasource;
import cn.leo.dynamic_multi_datasource.entity.Dept;
import cn.leo.dynamic_multi_datasource.mapper.DeptFirstDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author leo.z.l
 * @create 2019-09-07  17:00
 */
@Service
public class DeptService {

    @Autowired
    private DeptFirstDao deptFirstDao;

    @TargetDatasource(name = "db2")
    public Dept findById(Long id){
        return deptFirstDao.findById(id);
    }
}
